package com.ssy.lingxi.member.merchant.repository;

import com.ssy.lingxi.member.merchant.entity.MemberLevelConfigDO;
import com.ssy.lingxi.member.merchant.entity.MemberLevelRightDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * 会员等级权益操作类
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-10
 */
@Repository
public interface MemberLevelRightRepository extends JpaRepository<MemberLevelRightDO, Long>, JpaSpecificationExecutor<MemberLevelRightDO> {
    @Transactional
    void deleteAllBySubMemberIdAndSubRoleId(Long subMemberId, Long subRoleId);

    Boolean existsByMemberIdAndRoleIdAndLevelConfig(Long memberId, Long roleId, MemberLevelConfigDO levelConfigDO);
}
